package com.mtconnect.model;

import javax.ws.rs.QueryParam;
import java.util.Objects;

/**
 * Created by Administrator on 2017/9/6.
 */
public class SampleDTO {

    @QueryParam("path")
    private String xPath;

    @QueryParam("from")
    private String from;

    @QueryParam("count")
    private String count;

    //这是一个毫秒值
    @QueryParam("interval")
    private String interval;

    private String deviceName;

    @Override
    public String toString() {
        return "SampleDTO{" +
                "xPath='" + xPath + '\'' +
                ", from='" + from + '\'' +
                ", count='" + count + '\'' +
                ", interval='" + interval + '\'' +
                ", deviceName='" + deviceName + '\'' +
                '}';
    }

    public String getDeviceName() {
        return deviceName;
    }

    public void setDeviceName(String deviceName) {
        this.deviceName = deviceName;
    }

    public String getxPath() {
        if (Objects.nonNull(xPath) && "".equals(xPath.trim())) {
            return null;
        }
        return xPath;
    }

    public void setxPath(String xPath) {
        this.xPath = xPath;
    }

    public Long getFrom() {
        if (Objects.nonNull(from) && !"".equals(from.trim())) {
            return Long.valueOf(from);
        }
        return null;
    }

    public void setFrom(String from) {
        this.from = from;
    }

    public Long getCount() {
        if (Objects.nonNull(count) && !"".equals(count.trim())) {
            return Long.valueOf(count);
        }
        return null;
    }

    public void setCount(String count) {
        this.count = count;
    }

    public String getInterval() {
        if (Objects.nonNull(interval) && "".equals(interval.trim())) {
            return null;
        }
        return interval;
    }

    public void setInterval(String interval) {
        this.interval = interval;
    }
}
